package net.hpxn.gsmc.core.www;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;

public class WebServer {

	Server webServer;
	ServletContextHandler context;

	public WebServer( int port ) {
		webServer = new Server( port );

		context = new ServletContextHandler();
		context.setContextPath( "/" );
		webServer.setHandler( context );

		try {
			webServer.start();
		} catch ( Exception e ) {
			e.printStackTrace();
		}
	}

	public Server getWebServer() {
		return webServer;
	}

	public void setWebServer( Server webServer ) {
		this.webServer = webServer;
	}

	public ServletContextHandler getContext() {
		return context;
	}

	public void setContext( ServletContextHandler context ) {
		this.context = context;
	}
}
